<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, maximum-scale=1"/>
        <meta content="telephone=no,email=no" name="format-detection" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta content="yes" name="apple-touch-fullscreen">
		<title>认证</title>
		<link rel="stylesheet" type="text/css" href="css/layer.css"/>
		<link rel="stylesheet" type="text/css" href="css/basic.css"/>
		<link rel="stylesheet" type="text/css" href="css/form.css"/>
		<script src="js/jquery-3.1.1.min.js"></script>
		<script src="js/http.js"></script>
		<script src="js/layer.js"></script>
		<script src="js/common.js"></script>
		<script src="js/identify.js"></script>
		<style type="text/css">

		</style>
		<script>
			$(function(){
				$('form').attr('action',url+'renzheng');
				$.ajax({
					url:url+'getrenzheng',
					dataType:'json',
					type:'post',
					async:true,
					data:{},
					success:function(result){
						// console.log(result);
						var status = result.status;
						var code = result.code;
						if(status==1&&code=='1000'){
							var $data = result.data;

                           // $('#juzhong').selectedIndex=$data['juzhong'];
                            var juzhong = $data['juzhong'];
							$("#juzhong  option[value='"+juzhong+"']").attr("selected","selected");//动态设置option
							//$('#hangdang').selectedIndex=$data['hangdang'];
							var hangdang = $data['hangdang'];
							$("#hangdang  option[value='"+hangdang+"']").attr("selected","selected");
                            $('#danwei').val($data['danwei']);
							$('#liupai').val($data['liupai']);
							$('#rongyu').html($data['rongyu']);
							$('#yuanxiao').val($data['yuanxiao']);
							$('#shicong').val($data['shicong']);
							$('#jianjie').html($data['jianjie']);
							var images = $data['images'];
							//===========================生成老师的照片start===================
							if(images!=''&&images.length>0){
								var html='';
								for(var i=0;i<images.length;i++){
									html +='<div class="pre-img fl"><img src="'+images[i]+'" alt="" /></div>';
								}
								$('.upload-pic .pre-box').html(html);
								var imimages = result.imimages;
								html='';
								for(var i=0;i<imimages.length;i++){
									html +='<input type="file" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" data-require="*11" data-tip="请上传照片" value="'+imimages[i]+'" name="images[]"><input type="text" value="'+imimages[i]+'" name="images2[]" style="display: none">';
								}
								$('.upload-pic .add-btn').html(html);
								$('.submit-btn').val('修改');
							}
                            //==============================生成老师的照片end===================

							//=============================生成荣誉证书的图片 start========================

							var zhengshu = $data['zhengshu'];
							if(zhengshu!=''&&zhengshu.length>0){
								html='';
								for(var i=0;i<zhengshu.length;i++){
									html +='<div class="pre-img fl"><img src="'+zhengshu[i]+'" alt="" /></div>';
								}
								$('.upload-zizhi .pre-box').html(html);
								var zsimgs = result.zsimgs;
								html='';
								for(var i=0;i<zsimgs.length;i++){
									html +='<input type="file" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"  value="'+zsimgs[i]+'" name="zhengshu[]"><input type="text" value="'+zsimgs[i]+'" name="zhengshu2[]" style="display: none">';
								}
								$('.upload-zizhi .add-btn').html(html);
							}
                           //=============================生成荣誉证书的图片 end========================
						}else if(status==1&&code=='1002'){
						    alert('未登录');
							window.history.back();
						}else{
							alert('您不是老师不能认证');
							window.history.back();
						}
					}
					})
			})
		</script>
	</head>
	<body>
		<header class="header">
			<a href="javascript:window.history.back()" class="return-btn"></a>认证
		</header>
		<div class="form-box">
			<form action="#" method="post"  enctype="multipart/form-data">
				<ul>
			      <li>
			        <span>剧种<em>*</em></span>
			        <select name="juzhong" id="juzhong" class="form-input" data-require="*" data-tip="请选择剧种">
			        	<option value="">请选择剧种</option>
						<option value="0">京剧</option>
						<option value="1">评剧</option>
						<option value="2">梆子</option>
						<option value="3">豫剧</option>
						<option value="6">越剧</option>
			        </select>
			      </li>
			      <li>
			        <span>行当<em>*</em></span>
			        <select name="hangdang" id="hangdang" class="form-input" data-require="*" data-tip="请选择行当">
			        	<option value="">请选择行当</option>
			        	<optgroup label="生">
				            <option value="老生">老生</option>
				            <option value="小生">小生</option>
				            <option value="娃娃生">娃娃生</option>
				            <option value="武生">武生</option>
				            <option value="坤生">坤生</option>
				            <option value="红生">红生</option>
				        </optgroup>
				        <optgroup label="旦">
				            <option value="青衣">青衣</option>
				            <option value="花旦">花旦</option>
				            <option value="花衫">花衫</option>
				            <option value="武旦">武旦</option>
				            <option value="老旦">老旦</option>
				            <option value="男旦">男旦</option>
				        </optgroup>
				        <optgroup label="净">
				            <option value="正净">正净</option>
				            <option value="武净">武净</option>
				        </optgroup>
				        <optgroup label="丑">
				            <option value="文丑">文丑</option>
				            <option value="武丑">武丑</option>
			
				        </optgroup>
				        <optgroup label="乐器">
				            <option value="乐器">乐器</option>
				        </optgroup>
			        	
			        </select>
			      </li>
			      <li>
			        <span>所在单位<em>*</em></span><input type="text" class="form-input" name="danwei" id="danwei" placeholder="请输入单位" data-require="*" data-tip="请输入单位">
			      </li>
			      <li class="upload-box">
			        <span>照片（2张及以上）<em>*</em></span>
			        <div class="pic-box clearfix upload-pic">
			        	<div class="fl pre-box">
			        		
			        	</div>
			            <div class="add-btn fl">
			              <input type="file" class="images" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" data-require="*" data-tip="请上传照片" name="images[]">
			            </div>
			        </div>
			      </li>
			      <li>
			        <span>流派</span><input type="text" class="form-input" placeholder="请输入流派" name="liupai" id="liupai">
			      </li>
			      <li>
			        <span>所获荣誉</span><textarea name="rongyu" rows="" cols="" id="rongyu" class="form-input form-textarea" placeholder="请输入所获荣誉" ></textarea>
			      </li>
			      <li class="upload-box">
			        <span>资质证书</span>
			        <div class="pic-box clearfix upload-zizhi">
			        	<div class="fl pre-box">
			        		<!--<div class="pre-img fl">
			        			<img src="" alt="" />
			        		</div>-->
			        	</div>
			            <div class="add-btn fl">
			              <input type="file" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" name="zhengshu[]">
			            </div>
			        </div>
			      </li>
			      <li>
			        <span>毕业院校</span><input type="text" class="form-input" placeholder="请输入毕业院校" name="yuanxiao" id="yuanxiao">
			      </li>
			      <li>
			        <span>师从</span><input type="text" class="form-input" placeholder="请输入师从" name="shicong" id="shicong">
			      </li>
			      <li>
			        <span>简介</span><textarea name="jianjie" rows="" cols="" class="form-input form-textarea" placeholder="请输入简介" id="jianjie"></textarea>
			      </li>
			    </ul>
				<input type="submit" value="认证" class="submit-btn" onclick="return check()"/>
			</form>
		</div>
	</body>
</html>
